//
//  SDFocusModel.m
//  SuperDoctor
//
//  Created by 陶宏路 on 16/7/6.
//  Copyright © 2016年 SD. All rights reserved.
//
#import "SDFocusModel.h"
#import "SDNetWorkTool.h"
#import "NetWorkDefine.h"
@implementation SDFocusModel

-(instancetype)initWithDictionary:(NSDictionary*)dic{
    
    if (self = [super init]) {
        
        [self setValuesForKeysWithDictionary:dic];
        
    }return self;
}

+(void)getModelWithlock:(void(^)(NSArray*dataArray))success error:(void(^)())error{
    
        NSString *urlString = kMatchDoctors;
        NSDictionary *paramDic = @{@"ci1_id":@1,
                                   @"ci2_id":@3,
                                   @"ci3_id":@3,
                                   @"diagnosis_type":@0,
                                   @"page_size":@15,
                                   @"is_confirmed":@1,
                                   @"user_id":@1000089,
                                   @"page":@1,
                                   @"has_diagnosis":@2
                                   };
    
    [[SDNetWorkTool shareManager] POST_RequestWithUrlString:urlString parmas:paramDic successBloock:^(NSDictionary* responseObject) {
        
        NSArray * dataArray = responseObject[@"data"];
        
        NSMutableArray * mutableArray = [NSMutableArray array];
        
        [dataArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            
            SDFocusModel * model = [[SDFocusModel alloc]initWithDictionary:obj];
            
            [mutableArray addObject:model];
        }];
        
        if (success) {
            
            success(mutableArray.copy);
        }
        
    } failureBlock:^(NSError *error) {
        
        NSLog(@"error = %@",error);
    }];
    
}

-(NSString*)description{
    
    return [NSString stringWithFormat:@"%@--doctor_gender = %@-hospital_name = %@- doctor_name = %@",[super description],self.doctor_gender,self.doctor_hospital_name,self.doctor_name];
}

@end
